<%@ Page Language="C#" MasterPageFile="~/cms.master" AutoEventWireup="true" CodeFile="Storage.aspx.cs"
    Inherits="cms_Storage" Title="<%$Resources:Language,CmsStorageTitle %>" %>

<%@ Register Src="../controls/ctrlShowInfo.ascx" TagName="ctrlShowInfo" TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ac" %>
<%@ Register Src="~/controls/ctrlProductChoose.ascx" TagPrefix="uc" TagName="ctrlProductChoose" %>
<%@ Register Src="~/controls/ctrlSelectDateInterval.ascx" TagName="ctrlSelectDateInterval"
    TagPrefix="uc" %>
<%@ Register Src="~/controls/ctrlCategoryTreeView.ascx" TagName="CategoryTreeView"
    TagPrefix="uc" %>
<%@ Register Src="~/controls/ctrlSearchProduct.ascx" TagName="ctrlSearchProduct"
    TagPrefix="uc" %>
<%@ Register Src="~/controls/ctrlWait.ascx" TagName="ctrlWait" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="Server">

    <script language="javascript" type="text/javascript" src="../Javascript/Common.js"></script>

    <h2>
        <%=Resources.Language.Storage %></h2>
    <uc:ctrlWait ID="ctrlWait" runat="server" />
    <ac:TabContainer runat="server" ID="tbcMainTabs" ActiveTabIndex="0">
        <ac:TabPanel runat="server" ID="tabStoragePreview" HeaderText="<%$Resources:Language,StorageOverview %>">
            <ContentTemplate>
                <asp:UpdatePanel ID="upStoragePreview" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="storagePreview">
                            <uc:ctrlShowInfo ID="ctrlShowInfoStoragePreview" runat="server" />
                            <div class="vSeparate">
                                <uc:ctrlSearchProduct ID="ctrlSearchStoragePreview" runat="server" OnProductSearch="ctrlSearchProduct_ProductSearch"
                                    OnClearSearchCriteria="ctrlSearchProduct_ProductSearch" />
                            </div>
                            <table class="cctTable vSeparate">
                                <tr>
                                    <td>
                                        <ac:CollapsiblePanelExtender ID="cpCategory" runat="server" TargetControlID="pnlSearchCategory"
                                            ExpandControlID="pnlCategoryName" CollapseControlID="pnlCategoryName" Collapsed="True"
                                            ImageControlID="imColapseImg" ExpandedImage="../gfx/expand_smal.gif" CollapsedImage="../gfx/collapse_smal.gif"
                                            Enabled="True">
                                        </ac:CollapsiblePanelExtender>
                                        <div class="cctHeader">
                                            <span class="cctTrigger">
                                                <asp:Panel ID="pnlCategoryName" runat="server">
                                                    <asp:Image ID="imColapseImg" runat="server" ImageUrl="../gfx/collapse_smal.gif" />
                                                    <asp:Label ID="lblChoosenCategoryName" runat="server" Text="<%$ Resources:Language,AllCategories %>"></asp:Label>
                                                </asp:Panel>
                                            </span><span class="cctControl">
                                                <input id="btnStorageReport" type="button" runat="server" onclick="" value="<%$ Resources:Language,Remanent %>" />
                                            </span>
                                        </div>
                                        <asp:Panel ID="pnlSearchCategory" runat="server">
                                            <div class="cctContent">
                                                <uc:CategoryTreeView ID="ctrlCategoryTreeView" runat="server" OnSelectedNodeChange="CategoryTreeView_SelectedNodeChanged"
                                                    NodeSelectAction="Select" RootSelectAction="Select" />
                                            </div>
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                            <asp:GridView ID="gvStoragePreview" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                                OnSorting="gvStoragePreview_Sorting" AllowPaging="True" OnPageIndexChanging="gvStoragePreview_PageIndexChanging"
                                CssClass="cmsTables" OnRowDataBound="gvStoragePreview_RowDataBound" PageSize="50">
                                <Columns>
                                    <asp:BoundField DataField="ProductId" HeaderText="ID" SortExpression="ProductId" />
                                    <asp:BoundField DataField="ProductName" HeaderText="<%$ Resources:Language,Name %>"
                                        SortExpression="ProductName" />
                                    <asp:BoundField DataField="CategoryName" HeaderText="<%$ Resources:Language,Category %>"
                                        SortExpression="CategoryName" />
                                    <asp:BoundField DataField="AvailableCount" HeaderText="<%$ Resources:Language,Available %>"
                                        SortExpression="Available" />
                                    <asp:BoundField DataField="ReservedCount" HeaderText="<%$ Resources:Language,Reserved %>" />
                                    <asp:BoundField DataField="TotalCount" HeaderText="<%$ Resources:Language,Total %>" />
                                    <asp:BoundField DataField="PriceNetto" HeaderText="<%$ Resources:Language,ValueNetto %>"
                                        SortExpression="PriceNetto" DataFormatString="{0:f02}" />
                                    <asp:BoundField DataField="CostNetto" HeaderText="<%$ Resources:Language,CostNetto %>"
                                        SortExpression="Cost" DataFormatString="{0:f02}" />
                                    <asp:BoundField DataField="ProfitNetto" DataFormatString="{0:f02}" HeaderText="<%$ Resources:Language,ProfitNetto %>"
                                        SortExpression="Profit" />
                                    <asp:TemplateField HeaderText="<%$ Resources:Language,LastDelivery %>" SortExpression="DeliveryDate">
                                        <ItemTemplate>
                                            <%# (DateTime)Eval("DeliveryDate") != DateTime.MinValue ? ((DateTime)Eval("DeliveryDate")).ToShortDateString() : "-" %></ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="ctrlSearchStoragePreview" />
                    </Triggers>
                </asp:UpdatePanel>
            </ContentTemplate>
        </ac:TabPanel>
        <ac:TabPanel runat="server" ID="tabNewDelivery" HeaderText="<%$Resources:Language,NewDelivery %>">
            <ContentTemplate>
                <asp:UpdatePanel ID="upNewDelivery" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="newDelivery">
                            <uc:ctrlShowInfo ID="ctrlShowInfoNewDelivery" runat="server" />
                            <div class="vSeparate">
                                <span class="peBoxLeft"></span><span class="peBoxRight">
                                    <asp:Button ID="btnSaveNewDeliveryTop" runat="server" Text="<%$ Resources:Language,SaveDelivery %>"
                                        OnCommand="NewDeliveryCommand" CommandName="SaveDelivery" CausesValidation="False"
                                        Enabled="false" />
                                    <asp:Button ID="btnCancelNewDeliveryTop" runat="server" Text="<%$ Resources:Language,Cancel %>"
                                        OnCommand="NewDeliveryCommand" CommandName="CancelDelivery" CausesValidation="False" />
                                </span>
                            </div>
                            <div class="vSeparate">
                                <uc:ctrlSearchProduct ID="ctrlSearchNewDelivery" runat="server" OnProductSearch="ctrlSearchProduct_ProductSearch" />
                            </div>
                            <div class="vSeparate">
                                <uc:ctrlProductChoose ID="ctrlProductChooseNewDelivery" runat="server" AutoPostBack="false">
                                </uc:ctrlProductChoose>
                            </div>
                            <div class="vSeparate">
                                <span class="peBoxLeft">
                                    <%=Resources.Language.Amount %>: </span><span class="peBoxRight"><span class="peInnerBoxRight">
                                        <asp:TextBox ID="tbProductCount" runat="server" CssClass="TextInputShort"></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" ID="rfvProductCount" ErrorMessage="*"
                                            ControlToValidate="tbProductCount" ValidationGroup="AddDelivery" Display="Dynamic" />
                                        <asp:CompareValidator runat="server" ID="cvProductCount" ErrorMessage="*" Operator="DataTypeCheck"
                                            Type="Integer" ControlToValidate="tbProductCount" ValidationGroup="AddDelivery"
                                            Display="Dynamic"></asp:CompareValidator>
                                    </span><span class="peInnerBoxLeft">
                                        <%=Resources.Language.CostNetto %>: </span><span class="peInnerBoxRight">
                                            <asp:TextBox ID="tbDeliveryCostNetto" runat="server" CssClass="TextInputShort"></asp:TextBox>
                                            <asp:RequiredFieldValidator runat="server" ID="rfvDeliveryCostNetto" ErrorMessage="*"
                                                ControlToValidate="tbDeliveryCostNetto" ValidationGroup="AddDelivery" Display="Dynamic" />
                                            <asp:CompareValidator runat="server" ID="cpDeliveryCostNetto" ErrorMessage="*" ControlToValidate="tbDeliveryCostNetto"
                                                ValidationGroup="AddDelivery" Operator="DataTypeCheck" Type="Double" Display="Dynamic"></asp:CompareValidator>
                                        </span><span class="peInnerBoxLeft">
                                            <asp:Button ID="btnAddToDelivery" runat="server" Text="<%$ Resources:Language,Add %>"
                                                OnCommand="NewDeliveryCommand" CommandName="Add" ValidationGroup="AddDelivery" />
                                        </span></span>
                            </div>
                            <% if (gvNewDeliveryProductList.Rows.Count > 0)
                               { %>
                            <div class="vSeparate">
                                <span class="peBoxLeft">
                                    <%= Resources.Language.CurrentlyInDelivery%>: </span><span class="peBoxRight">
                                        <asp:GridView ID="gvNewDeliveryProductList" runat="server" CellPadding="10" AutoGenerateColumns="False"
                                            CssClass="cmsTables" OnRowCancelingEdit="gvNewDeliveryProductList_RowCancelingEdit"
                                            OnRowDeleting="gvNewDeliveryProductList_RowDeleting" OnRowEditing="gvNewDeliveryProductList_RowEditing"
                                            OnRowUpdating="gvNewDeliveryProductList_RowUpdating">
                                            <Columns>
                                                <asp:BoundField DataField="ProductID" HeaderText="ID" ReadOnly="True">
                                                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="Name" HeaderText="<%$ Resources:Language,Name %>" ReadOnly="True">
                                                    <ItemStyle HorizontalAlign="Center" Width="50%" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="Count" HeaderText="<%$ Resources:Language,Amount %>">
                                                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                    <ControlStyle CssClass="TextInputVeryShort" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="CostNetto" HeaderText="<%$ Resources:Language,CostNetto %>">
                                                    <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                    <ControlStyle CssClass="TextInputVeryShort" />
                                                </asp:BoundField>
                                                <asp:BoundField HeaderText="<%$ Resources:Language,PriceNetto %>" DataField="SellPriceNetto"
                                                    DataFormatString="{0:f}" ReadOnly="true">
                                                    <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                </asp:BoundField>
                                                <asp:CommandField CancelText="<%$ Resources:Language,Cancel %>" UpdateText="<%$ Resources:Language,Update %>"
                                                    EditText="<%$ Resources:Language,Edit %>" ShowEditButton="True" />
                                                <asp:CommandField DeleteText="<%$ Resources:Language,DeleteUpper %>" ShowDeleteButton="True" />
                                            </Columns>
                                        </asp:GridView>
                                    </span>
                            </div>
                            <%} %>
                            <div class="vSeparate">
                                <span class="peBoxLeft">
                                    <%=Resources.Language.DeliveryNotes %>: </span><span class="peBoxRight">
                                        <asp:TextBox ID="tbComments" runat="server" TextMode="MultiLine" CssClass="TextInputMultiline"></asp:TextBox>
                                    </span>
                            </div>
                            <div class="vSeparate">
                                <span class="peBoxLeft"></span><span class="peBoxRight">
                                    <asp:Button ID="btnSaveNewDeliveryBottom" runat="server" Text="<%$ Resources:Language,SaveDelivery %>"
                                        OnCommand="NewDeliveryCommand" CommandName="SaveDelivery" CausesValidation="False"
                                        Enabled="false" OnClientClick="ScrollTop();" />
                                    <asp:Button ID="btnCancelNewDeliveryBottom" runat="server" Text="<%$ Resources:Language,Cancel %>"
                                        OnCommand="NewDeliveryCommand" CommandName="CancelDelivery" CausesValidation="False"
                                        OnClientClick="ScrollTop();" />
                                </span>
                            </div>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="ctrlSearchNewDelivery" />
                    </Triggers>
                </asp:UpdatePanel>
            </ContentTemplate>
        </ac:TabPanel>
        <ac:TabPanel runat="server" ID="tabReturn" HeaderText="<%$Resources:Language,ProductReturn %>">
            <ContentTemplate>
                <asp:UpdatePanel ID="upReturnList" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="returnDelivery">
                            <uc:ctrlShowInfo ID="ctrlShowInfoReturn" runat="server" />
                            <div class="vSeparate">
                                <span class="peBoxLeft"></span><span class="peBoxRight">
                                    <asp:Button ID="btnSaveReturnDeliveryTop" runat="server" Text="<%$ Resources:Language,SaveReturn %>"
                                        OnCommand="btnDeliveryReturn_Command" CommandArgument="Save" CausesValidation="False"
                                        Enabled="false" />
                                    <asp:Button ID="btnCancelReturnDeliveryTop" runat="server" Text="<%$ Resources:Language,Cancel %>"
                                        OnCommand="btnDeliveryReturn_Command" CommandArgument="Cancel" CausesValidation="False" />
                                </span>
                            </div>
                            <div class="vSeparate">
                                <uc:ctrlSearchProduct ID="ctrlSearchReturnDelivery" runat="server" OnProductSearch="ctrlSearchProduct_ProductSearch" />
                            </div>
                            <div class="vSeparate">
                                <uc:ctrlProductChoose ID="ctrlProductChooseInReturn" runat="server" OnProductListIndexChanged="ctrlProductChooseInReturn_ProductSelected"
                                    AutoPostBack="true" AvailableProductsOnly="true"></uc:ctrlProductChoose>
                            </div>
                            <% if (gvProductDeliveries.Rows.Count > 0)
                               {%>
                            <div class="vSeparate">
                                <span class="peBoxLeft">
                                    <%= Resources.Language.ChooseSpecimens%>: </span><span class="peBoxRight">
                                        <asp:GridView CssClass="cmsTables" ID="gvProductDeliveries" runat="server" AutoGenerateColumns="False"
                                            OnRowDataBound="gvProductDeliveries_RowDataBound">
                                            <Columns>
                                                <asp:BoundField HeaderText="Id" DataField="DeliveryID" ItemStyle-Width="4%" />
                                                <asp:BoundField HeaderText="<%$ Resources:Language,User %>" DataField="UserName"
                                                    ItemStyle-Width="13%" />
                                                <asp:BoundField HeaderText="<%$ Resources:Language,Comment %>" DataField="Comments"
                                                    ItemStyle-Width="20%" />
                                                <asp:TemplateField HeaderText="<%$ Resources:Language,Date %>" ItemStyle-Width="13%">
                                                    <ItemTemplate>
                                                        <%# ((DateTime)Eval("Date")).ToShortDateString()%></ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField HeaderText="<%$ Resources:Language,Left %>" DataField="LeftCount"
                                                    ItemStyle-Width="13%" />
                                                <asp:BoundField DataField="AmountNetto" HeaderText="<%$ Resources:Language,CostNetto %>"
                                                    ItemStyle-Width="13%" />
                                                <asp:TemplateField HeaderText="<%$ Resources:Language,Amount %>" ItemStyle-Width="24%">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="tbReturnProductCount" runat="server" CssClass="TextInputVeryShort"></asp:TextBox>
                                                        <asp:Button ID="btnReturnProductAdd" runat="server" Text="<%$Resources:Language,Add %>"
                                                            CausesValidation="false" OnCommand="btnReturnProductAdd_Command" CommandArgument='<%#Eval("DeliveryID") %>' /></ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </span>
                            </div>
                            <%} %>
                            <% if (gvProductsToReturnList.Rows.Count > 0)
                               { %>
                            <div class="vSeparate">
                                <span class="peBoxLeft">
                                    <%= Resources.Language.ChoosedSpecimens%>: </span><span class="peBoxRight">
                                        <asp:GridView ID="gvProductsToReturnList" runat="server" AutoGenerateColumns="False"
                                            OnRowDataBound="gvProductsToReturnList_RowDataBound" CssClass="cmsTables" OnRowDeleting="gvProductsToReturnList_RowDeleting">
                                            <Columns>
                                                <asp:BoundField DataField="ProductID" HeaderText="ID" ReadOnly="True" />
                                                <asp:BoundField DataField="Name" HeaderText="<%$ Resources:Language,Name %>" ReadOnly="True" />
                                                <asp:BoundField DataField="Count" HeaderText="<%$ Resources:Language,Amount %>" />
                                                <asp:TemplateField HeaderText="<%$ Resources:Language,Delivery %>">
                                                    <ItemTemplate>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:CommandField DeleteText="<%$ Resources:Language,DeleteUpper %>" ShowDeleteButton="True" />
                                            </Columns>
                                        </asp:GridView>
                                    </span>
                            </div>
                            <% } %>
                            <div class="vSeparate">
                                <span class="peBoxLeft">
                                    <%= Resources.Language.ReturnNotes %>: </span><span class="peBoxRight">
                                        <asp:TextBox ID="tbReturnDeliveryComments" runat="server" TextMode="MultiLine" CssClass="TextInputMultiline"></asp:TextBox>
                                    </span>
                            </div>
                            <div class="vSeparate">
                                <span class="peBoxLeft"></span><span class="peBoxRight">
                                    <asp:Button ID="btnSaveReturnDeliveryBottom" runat="server" Text="<%$ Resources:Language,SaveReturn %>"
                                        OnCommand="btnDeliveryReturn_Command" CommandArgument="Save" CausesValidation="False"
                                        Enabled="false" OnClientClick="ScrollTop();" />
                                    <asp:Button ID="btnCancelReturnDeliveryBottom" runat="server" Text="<%$ Resources:Language,Cancel %>"
                                        OnCommand="btnDeliveryReturn_Command" CommandArgument="Cancel" CausesValidation="False"
                                        OnClientClick="ScrollTop();" />
                                </span>
                            </div>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="ctrlSearchReturnDelivery" />
                    </Triggers>
                </asp:UpdatePanel>
            </ContentTemplate>
        </ac:TabPanel>
        <ac:TabPanel runat="server" ID="tabStorageHistory" HeaderText="<%$Resources:Language,History %>">
            <ContentTemplate>
                <asp:UpdatePanel ID="upStorageHistory" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                    <ContentTemplate>
                        <uc:ctrlShowInfo ID="ctrlShowInfoStorageHistory" runat="server" />
                        <div class="vSeparate">
                            <%= Resources.Language.Deliveries %><uc:ctrlSelectDateInterval ID="CtrlSelectDateInterval"
                                runat="server" />
                            <asp:Button ID="btnFindDeliveriesHistory" runat="server" Text="<%$ Resources:Language,Show %>"
                                OnClick="btnFindDeliveriesHistory_Click" CausesValidation="False" />
                            <asp:Button ID="btnAllDeliveriesHistory" runat="server" Text="<%$ Resources:Language,ShowAll %>"
                                OnClick="btnAllDeliveriesHistory_Click" CausesValidation="False" />
                        </div>
                        <% if (gvDeliveriesHistory.Rows.Count > 0)
                           { %>
                        <div class="vSeparate">
                            <asp:GridView ID="gvDeliveriesHistory" runat="server" AutoGenerateColumns="False"
                                CellPadding="3" DataKeyNames="DeliveryID" PageSize="20" AllowPaging="True" OnPageIndexChanging="gvDeliveriesHistory_PageIndexChanging"
                                OnSelectedIndexChanging="gvDeliveriesHistory_SelectedIndexChanging" CssClass="cmsTables">
                                <Columns>
                                    <asp:BoundField HeaderText="<%$ Resources:Language,ID %>" DataField="DeliveryID"
                                        SortExpression="Sort_ID">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" Width="5%" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="<%$ Resources:Language,Date %>" DataField="Date" DataFormatString="{0:f}"
                                        SortExpression="Sort_Data">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" Width="15%" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="<%$ Resources:Language,VAlue %>" DataField="AmountNetto"
                                        SortExpression="Sort_Price">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" Width="15%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Comments" HeaderText="<%$ Resources:Language,Comment %>">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" Width="50%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="UserName" HeaderText="<%$ Resources:Language,User %>">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                                    </asp:BoundField>
                                    <asp:CommandField SelectText="<%$ Resources:Language,ShowProducts %>" ShowSelectButton="True">
                                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                                    </asp:CommandField>
                                </Columns>
                                <SelectedRowStyle BackColor="#FFFFC0" />
                            </asp:GridView>
                        </div>
                        <%} %>
                        <% if (gvDeliveriesHistoryProducts.Rows.Count > 0)
                           { %>
                        <div class="vSeparate">
                            <asp:GridView ID="gvDeliveriesHistoryProducts" runat="server" CellPadding="10" AutoGenerateColumns="False"
                                CssClass="cmsTables">
                                <Columns>
                                    <asp:BoundField DataField="ProductName" HeaderText="<%$ Resources:Language,NAme %>">
                                        <ItemStyle HorizontalAlign="Center" Width="50%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Count" HeaderText="<%$ Resources:Language,AmountInDelivery %>">
                                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="AvailableCount" HeaderText="<%$ Resources:Language,AvailableCount %>">
                                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="PriceNetto" HeaderText="<%$ Resources:Language,AverageSellPrice %>"
                                        DataFormatString="{0:f}">
                                        <ItemStyle HorizontalAlign="Center" Width="15%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="CostNetto" HeaderText="<%$ Resources:Language,BuyPrice %>">
                                        <ItemStyle HorizontalAlign="Center" Width="15%" />
                                    </asp:BoundField>
                                </Columns>
                            </asp:GridView>
                        </div>
                        <%} %>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </ContentTemplate>
        </ac:TabPanel>
        <ac:TabPanel ID="tabProductsDelivery" runat="server" HeaderText="<%$Resources:Language, ProductsDeliveries %>">
            <ContentTemplate>
                <asp:UpdatePanel ID="upProductsDelivery" runat="server" ChildrenAsTriggers="true"
                    UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="productsDelivery">
                            <uc:ctrlShowInfo ID="ctrlShowInfoProuctsDelivery" runat="server" />
                            <div class="vSeparate">
                                <uc:ctrlSearchProduct ID="ctrlSearchProductsDelivery" runat="server" OnProductSearch="ctrlSearchProduct_ProductSearch" />
                            </div>
                            <div class="vSeparate">
                                <uc:ctrlProductChoose ID="ctrlProductChooseInProductsDeliveries" runat="server" OnProductListIndexChanged="ProductInProductsDeliveriesChanged"
                                    AutoPostBack="true" />
                            </div>
                            <div class="vSeparate">
                                <asp:GridView ID="gvProductsInDeliveries" runat="server" AutoGenerateColumns="false"
                                    CssClass="cmsTables">
                                    <Columns>
                                        <asp:BoundField DataField="DeliveryID" ItemStyle-Width="5%" HeaderText="ID" />
                                        <asp:BoundField DataField="UserName" ItemStyle-Width="15%" HeaderText="<%$Resources:Language,User%>" />
                                        <asp:BoundField DataField="Comments" ItemStyle-Width="35%" HeaderText="<%$Resources:Language,Comment %>" />
                                        <asp:BoundField DataField="DeliveredCount" ItemStyle-Width="15%" HeaderText="<%$Resources:Language,Ordered %>" />
                                        <asp:BoundField DataField="LeftCount" ItemStyle-Width="15%" HeaderText="<%$Resources:Language,LeftInStorage%>" />
                                        <asp:BoundField DataField="AmountNetto" ItemStyle-Width="15%" HeaderText="<%$Resources:Language,PriceNetto%>" />
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="ctrlSearchProductsDelivery" />
                    </Triggers>
                </asp:UpdatePanel>
            </ContentTemplate>
        </ac:TabPanel>
    </ac:TabContainer>
</asp:Content>
